#include <bits/stdc++.h>
using namespace std;
int a[200001];
int main() {
    freopen("color.in", "r", stdin);
    freopen("color.out", "w", stdout);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    sort(a, a + n);
    int _n = unique(a, a + n) - a;
    cout << n - _n - 1 << endl;
    return 0;
}
